<ol class="breadcrumb" >
    <li> <i class="fa fa-anchor"></i>
        &nbsp;系统管理
    </li>
    <li>添加管理员</li>
</ol>

<div class="col-xs-12 info-center">
    <div class="bs-callout bs-callout-warning">
        <h4>
            系统使用单位: <strong>{:C('COLLEGE_NAME')}</strong>
        </h4>
    </div>
</div>

<div class="col-xs-12 info-center">
<div class="panel panel-mcit">
    <div class="panel-heading" >
        <h5 class="panel-title">添加用户
    </div>
    <div class="panel-body">
        <div class="alert alert-warning">
            <p><i class="fa fa-paperclip"></i>&nbsp;准确填写用户信息</p>
        </div>
        <form class="mcit-dataform" id="data_form" method="post" action="__URL__/addUser">
        <div class="panel-footer">    
            <div class="panel-mcit">

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">姓名</span>
                        <input type="text" id="name" name="name" class="form-control" placeholder="姓名">
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">登录账号</span>
                        <input type="text" id="account" name="account" class="form-control" placeholder="登录账号">
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">角色</span>
                        <select name="role" id="role" class="form-control">
                            <volist name="roleInfo" id="vo">
                                <option value="{$vo.id}#{$vo.name}">{$vo.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="clearfix" ></div>
                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">公司</span>
                        <select name="department" id="department" class="form-control">
                            <volist name="department" id="vo">
                                <option value="{$vo.major_str}#{$vo.id}">{$vo.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <button type="submit" class="btn btn-warning"><i class="fa fa-upload"></i>&nbsp;确定添加</button>
                </div>
                <div class="clearfix"></div>

            </div>
        </div>
        </form>
    </div>
</div>
</div>
<script>
    $("#data_form").ajaxForm({
        dataType:'json',
        clearForm:true,
        beforeSubmit:function(){
            if($("#name").val()==''){
                alertify.error("请填写账号使用者姓名");
                return false;
            }
            if($("#account").val()==''){
                alertify.error("请填写登录账号");
                return false;
            }
            if($("#role").val()==''){
                alertify.error("请选择角色");
                return false;
            }
            return true
        },
        success:function(data){
            if(data.state==100){
                alertify.success(data.msg);
                location.href = data.url;
            }else{
                alertify.error(data.msg);
            }
        }
    });
</script>